<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据统计 - 疫苗预约系统</title>
    <link rel="stylesheet" href="../css/common.css?v=20251120_5">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
</head>
<body>
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <i class="fas fa-syringe"></i>
                <h2>疫苗预约系统</h2>
                <p>接种点管理员</p>
            </div>
            <nav class="sidebar-menu">
                <a href="home.html" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>首页</span>
                </a>
                <a href="inventory.html" class="menu-item">
                    <i class="fas fa-boxes"></i>
                    <span>库存管理</span>
                </a>
                <a href="appointment.html" class="menu-item">
                    <i class="fas fa-calendar-check"></i>
                    <span>预约管理</span>
                </a>
                <a href="statistics.html" class="menu-item active">
                    <i class="fas fa-chart-bar"></i>
                    <span>数据统计</span>
                </a>
            </nav>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content" id="mainContent">
            <!-- 低库存预警提示条 -->
            <div class="low-stock-alert-bar" id="lowStockAlertBar">
                <div class="low-stock-alert-content">
                    <i class="fas fa-exclamation-triangle low-stock-alert-icon"></i>
                    <span class="low-stock-alert-text" id="lowStockAlertText">检测到低库存预警，请及时补充库存</span>
                </div>
                <button class="low-stock-alert-close" onclick="closeLowStockAlert()">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <!-- 顶部导航栏 -->
            <div class="top-navbar">
                <div class="navbar-left">
                    <h1>数据统计</h1>
                </div>
                <div class="navbar-right">
                    <div class="user-info">
                        <div class="user-avatar" id="userAvatar">A</div>
                        <span class="user-name" id="userName">管理员</span>
                    </div>
                    <button class="btn-logout" onclick="handleLogout()">
                        <i class="fas fa-sign-out-alt"></i> 退出登录
                    </button>
                </div>
            </div>

            <!-- 内容区域 -->
            <div class="content-area">
                <!-- 页面标题 -->
                <div class="page-header">
                    <h2 class="page-title">数据统计</h2>
                    <p class="page-subtitle">查看本接种点的统计数据</p>
                </div>

                <!-- 统计卡片 -->
                <div class="stats-grid">
                    <div class="stat-card">
                        <div class="stat-icon primary">
                            <i class="fas fa-calendar-check"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="totalAppointments">0</h3>
                            <p>总预约数</p>
                        </div>
                    </div>

                    <div class="stat-card">
                        <div class="stat-icon warning">
                            <i class="fas fa-clock"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="pendingAppointments">0</h3>
                            <p>待接种</p>
                        </div>
                    </div>

                    <div class="stat-card">
                        <div class="stat-icon success">
                            <i class="fas fa-check-circle"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="completedAppointments">0</h3>
                            <p>已完成</p>
                        </div>
                    </div>

                    <div class="stat-card">
                        <div class="stat-icon danger">
                            <i class="fas fa-boxes"></i>
                        </div>
                        <div class="stat-info">
                            <h3 id="inventoryCount">0</h3>
                            <p>库存种类</p>
                        </div>
                    </div>
                </div>

                <!-- 图表区域 -->
                <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px;">
                    <!-- 预约状态分布 -->
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">预约状态分布</h3>
                        </div>
                        <div class="card-body">
                            <div id="statusChart" style="width: 100%; height: 300px;"></div>
                        </div>
                    </div>

                    <!-- 疫苗类型分布 -->
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">疫苗类型分布</h3>
                        </div>
                        <div class="card-body">
                            <div id="vaccineTypeChart" style="width: 100%; height: 300px;"></div>
                        </div>
                    </div>
                </div>

                <!-- 库存信息 -->
                <div class="card">
                    <div class="card-header">
                        <h3 class="card-title">库存信息</h3>
                    </div>
                    <div class="card-body">
                        <div id="inventoryChart" style="width: 100%; height: 400px;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="../js/common.js?v=20251120_12"></script>
    <script src="js/statistics.js?v=20251120_12"></script>
</body>
</html>

